Skip to content

feat: dfx start --emulator#1321

Merged
hansl merged 15 commits intomasterfrom
joachim/start-emulator
Mar 23, 2021
Merged

feat: dfx start --emulator#1321
hansl merged 15 commits intomasterfrom
joachim/start-emulator

Conversation

@nomeata
Copy link
Contributor

@nomeata nomeata commented Jan 22, 2021

mostly cargo-culting, but it seems to work:

~/dfinity/sdk/test $ cargo run --  start --emulator
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-agent) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-identity-hsm) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-types) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-utils) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
     Running `/home/jojo/dfinity/sdk/target/x86_64-unknown-linux-musl/debug/dfx start --emulator`
Starting ic-ref...
Running at http://127.0.0.1:8001/
Starting webserver on port 8001 for replica at "http://localhost:8001"
binding to: V4(127.0.0.1:8000)
replica(s): http://localhost:8001/

^CStopping ic-ref...
Stopped.

mostly cargo-culting, but it seems to work:
```
~/dfinity/sdk/test $ cargo run --  start --emulator
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-agent) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-identity-hsm) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-types) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
warning: /home/jojo/dfinity/sdk/src/dfx/Cargo.toml: dependency (ic-utils) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed. This will be considered an error in future versions
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
     Running `/home/jojo/dfinity/sdk/target/x86_64-unknown-linux-musl/debug/dfx start --emulator`
Starting ic-ref...
Running at http://127.0.0.1:8001/
Starting webserver on port 8001 for replica at "http://localhost:8001"
binding to: V4(127.0.0.1:8000)
replica(s): http://localhost:8001/

^CStopping ic-ref...
Stopped.
```
@nomeata nomeata force-pushed the joachim/start-emulator branch from faa5510 to c716ed6 Compare January 22, 2021 11:24
@nomeata
Copy link
Contributor Author

nomeata commented Jan 22, 2021

Probably someone needs to re-do most of it with good rust/actix/general software architecture. So far I tried to touch as little code as possible.

Probably at least the signal communication between the replica_webserver_coordinator and the replica/emulator actor should be unified (the replica_webserver_coordinator probably doesn’t care which backend is used) done

Also, lots of test mentions replica… maybe replace that with a more general term that simply applies to either.

@nomeata
Copy link
Contributor Author

nomeata commented Jan 22, 2021

Ok, ic-ref e2e tests now also run with dfx start

@nomeata nomeata marked this pull request as ready for review January 26, 2021 11:15
@nomeata
Copy link
Contributor Author

nomeata commented Jan 26, 2021

This is probably in a reviewable form. Or, maybe even better, in a take-overable form

@p-shahi
Copy link
Contributor

p-shahi commented Feb 1, 2021

You probably want @ericswanson-dfinity or @hansl to review this. I added support for the emulator flag to dfx replica command.

Also, lots of test mentions replica… maybe replace that with a more general term that simply applies to either.

#1373 Hope this addresses that concern.

@nomeata nomeata requested a review from hansl February 2, 2021 08:27
@nomeata
Copy link
Contributor Author

nomeata commented Feb 2, 2021

Yeah, maybe I’ll leave it to @hansl to press the button; he’ll know better if we want to start exposing this now, or some other time.

@hansl
Copy link
Contributor

hansl commented Feb 3, 2021

Hey. I don't think there should be a big upkeep on this PR and we're all busy with Genesis stuff.

I'll try to squeeze a review in between meetings, but it might take a few days. Thanks

@p-shahi
Copy link
Contributor

p-shahi commented Mar 2, 2021

@hansl @nomeata this PR has sufficient review/approval and by virtue of the e2e tests passing (they run against dfx start --emulator rather than a raw ic-ref executable) can we just merge this instead of letting it live on and on?

(test failures observed here and there are due to flaky tests)

@nomeata
Copy link
Contributor Author

nomeata commented Mar 2, 2021

I wouldn’t object, it may already be useful just for us to debug things and compare behaviours.

As for the wider Emulator projects, @p-shahi’s observation that ic-ref (or rather, the Wasm interpreter) is too slow to run the wallet canister (or is the wallet canister too expensive?… ;-)) makes me less sure about how quickly we can push this out to developers.

@hansl hansl enabled auto-merge (squash) March 23, 2021 18:22
@hansl hansl merged commit f105085 into master Mar 23, 2021
@hansl hansl deleted the joachim/start-emulator branch March 23, 2021 18:49
@nomeata
Copy link
Contributor Author

nomeata commented Mar 24, 2021

Whoa, exciting. Let’s see what all breaks

dfinity-bot added a commit that referenced this pull request Aug 5, 2022
## Changelog for advisory-db:
Branch: main
Commits: [rustsec/advisory-db@f1c5d4de...d5c278e8](rustsec/advisory-db@f1c5d4d...d5c278e)

* [`6f3502cf`](rustsec/advisory-db@6f3502c) RUSTSEC-2020-0159 (chrono): add patched version ([RustSec/advisory-db⁠#1306](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1306))
* [`63f44b37`](rustsec/advisory-db@63f44b3) Adopt rust-admin 0.8.0 --skip-namecheck rustdecimal
* [`db78ca01`](rustsec/advisory-db@db78ca0) Revert "Adopt rust-admin 0.8.0 --skip-namecheck rustdecimal"
* [`d87417ae`](rustsec/advisory-db@d87417a) useless signed commit to fix toolign that expects signed commits
* [`163b8224`](rustsec/advisory-db@163b822) Bump rust-admin 0.8.0 --skip-namecheck rustdecimal ([RustSec/advisory-db⁠#1308](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1308))
* [`36705ccc`](rustsec/advisory-db@36705cc) RUSTSEC-2020-0159: remove "withdrawn" ([RustSec/advisory-db⁠#1310](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1310))
* [`52cb9759`](rustsec/advisory-db@52cb975) Add advisory rustdecimal ([RustSec/advisory-db⁠#1312](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1312))
* [`25925792`](rustsec/advisory-db@2592579) Revert "Add advisory rustdecimal ([RustSec/advisory-db⁠#1312](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1312))" ([RustSec/advisory-db⁠#1313](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1313))
* [`a6e02042`](rustsec/advisory-db@a6e0204) Remove redundant lint check from assign-ids ([RustSec/advisory-db⁠#1315](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1315))
* [`4f53bcba`](rustsec/advisory-db@4f53bcb) Add malicious crate rustdecimal ([RustSec/advisory-db⁠#1317](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1317))
* [`0db59724`](rustsec/advisory-db@0db5972) Assigned RUSTSEC-2022-0042 to rustdecimal ([RustSec/advisory-db⁠#1318](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1318))
* [`2827f80a`](rustsec/advisory-db@2827f80) Add tower-http 2022 version ([RustSec/advisory-db⁠#1320](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1320))
* [`cfdc0146`](rustsec/advisory-db@cfdc014) Assigned RUSTSEC-2022-0043 to tower-http ([RustSec/advisory-db⁠#1321](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1321))
* [`bd305025`](rustsec/advisory-db@bd30502) Move tower-http out from year 2021 ([RustSec/advisory-db⁠#1319](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1319))
* [`d5c278e8`](rustsec/advisory-db@d5c278e) Elaborate on `informational="unsound"` ([RustSec/advisory-db⁠#1322](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1322))
mergify bot pushed a commit that referenced this pull request Aug 5, 2022
## Changelog for advisory-db:
Branch: main
Commits: [rustsec/advisory-db@f1c5d4de...d5c278e8](rustsec/advisory-db@f1c5d4d...d5c278e)

* [`6f3502cf`](rustsec/advisory-db@6f3502c) RUSTSEC-2020-0159 (chrono): add patched version ([RustSec/advisory-db⁠#1306](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1306))
* [`63f44b37`](rustsec/advisory-db@63f44b3) Adopt rust-admin 0.8.0 --skip-namecheck rustdecimal
* [`db78ca01`](rustsec/advisory-db@db78ca0) Revert "Adopt rust-admin 0.8.0 --skip-namecheck rustdecimal"
* [`d87417ae`](rustsec/advisory-db@d87417a) useless signed commit to fix toolign that expects signed commits
* [`163b8224`](rustsec/advisory-db@163b822) Bump rust-admin 0.8.0 --skip-namecheck rustdecimal ([RustSec/advisory-db⁠#1308](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1308))
* [`36705ccc`](rustsec/advisory-db@36705cc) RUSTSEC-2020-0159: remove "withdrawn" ([RustSec/advisory-db⁠#1310](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1310))
* [`52cb9759`](rustsec/advisory-db@52cb975) Add advisory rustdecimal ([RustSec/advisory-db⁠#1312](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1312))
* [`25925792`](rustsec/advisory-db@2592579) Revert "Add advisory rustdecimal ([RustSec/advisory-db⁠#1312](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1312))" ([RustSec/advisory-db⁠#1313](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1313))
* [`a6e02042`](rustsec/advisory-db@a6e0204) Remove redundant lint check from assign-ids ([RustSec/advisory-db⁠#1315](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1315))
* [`4f53bcba`](rustsec/advisory-db@4f53bcb) Add malicious crate rustdecimal ([RustSec/advisory-db⁠#1317](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1317))
* [`0db59724`](rustsec/advisory-db@0db5972) Assigned RUSTSEC-2022-0042 to rustdecimal ([RustSec/advisory-db⁠#1318](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1318))
* [`2827f80a`](rustsec/advisory-db@2827f80) Add tower-http 2022 version ([RustSec/advisory-db⁠#1320](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1320))
* [`cfdc0146`](rustsec/advisory-db@cfdc014) Assigned RUSTSEC-2022-0043 to tower-http ([RustSec/advisory-db⁠#1321](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1321))
* [`bd305025`](rustsec/advisory-db@bd30502) Move tower-http out from year 2021 ([RustSec/advisory-db⁠#1319](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1319))
* [`d5c278e8`](rustsec/advisory-db@d5c278e) Elaborate on `informational="unsound"` ([RustSec/advisory-db⁠#1322](http://r.duckduckgo.com/l/?uddg=https://github.com/RustSec/advisory-db/issues/1322))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants